<!DOCTYPE html>
<html>
<head lang="en">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no" />
    <title></title>
    <link href="{$Think.config.RESOURCEURL}wx_assets/css/common.css" rel="stylesheet" type="text/css">
    <link href="{$Think.config.RESOURCEURL}wx_assets/shenqi/artifactList.css{$Think.config.RESOURCE_VER}" rel="stylesheet" type="text/css">
    <script src="{$Think.config.RESOURCEURL}wx_assets/js/zepto.1.1.3.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="{$Think.config.RESOURCEURL}wx_assets/js/zepto.alert.js"></script>
    <script src="{$Think.config.RESOURCEURL}wx_assets/js/util.js{$Think.config.RESOURCE_VER}" type="text/javascript"></script>
    <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script type="text/javascript" src="{$Think.config.RESOURCEURL}wx_assets/js/wx_share.js{$Think.config.RESOURCE_VER}"></script>  
</head>
<body>
    <div class="artifactList">
        <div class="info">
            <div id="fanBtn" style="padding-right:15px;text-align:right;line-height: 40px;color: #0873C0;text-decoration: underline;">反馈有奖</div>
            <img class="headImg" src="{$headimgurl}">
            <div class="title">{$nickname}共发出红包</div>
            <div class="allMoney">{$totalRedAmount}元</div>
            <a class="deliver" href='{$Think.config.SERVER_HOST}call.html?customerId={$customerId}&module=shenqi&force=1&method=getSend&params=%7B"qId"%3A"{$qId}"%7D'>我要发红包</a>
        </div>
        <div class="list">
            <if condition="$list neq ''">
            <ul>
                <volist name="list" id="item">
                    <li id="item_{$item.id}" onclick="artifact.go({$item.id})">
                        <div class="money">
                        <if condition="$item.isRed eq 1 and $item.status eq 0">
                            <label id="overtotal_{$item.id}">{$item.stotal}</label>/{$item.total}元
                        </if>
                        <if condition="$item.isRed eq 1 and $item.status eq 1">
                            {$item.stotal}/{$item.total}元
                        </if>
                        <if condition="$item.isRed eq 1 and $item.status eq 2">
                            退{$item.rolltotal}元
                        </if>
                        </div>
                        <div class="content">{$item.title}</div>
                        <div class="time"><em style="display:inline-block;width:80px;">{$item.date}</em>
                        <if condition="($item.status eq 2) and ($item.isRed eq 1)">
                            <a class="tui">退</a>
                            <else/>
                            <a style="visibility:hidden;">退</a>
                        </if>
                        <span onclick="artifact.delete({$item.id},{$item.isRed})">&nbsp;</span></div>
                    </li>
                </volist>
            </ul>
                <else/>
            <div class="noList">
                <span>主人你还没发表呢哦</span>
                <img src="{$Think.config.RESOURCEURL}wx_assets/shenqi/img/bigWhite.png">
            </div>
            </if>
        </div>
    </div>
    <div class="fankui-box" id="FBox">
        <i></i>
        <img class="logo" src="{$Think.config.RESOURCEURL}wx_assets/shenqi/img/logo.png">
        <div class="qr_code">
            <img src="{$Think.config.RESOURCEURL}wx_assets/shenqi/img/qr_code.jpg{$Think.config.RESOURCE_VER}">
            <div class="info">
            安静下来，倾听你的声音
            </div>
        </div>
    </div>
</body>
<script>
    var baseUrl = '{$Think.config.SERVER_HOST}';
    var artifact={
        delete:function(id,isRed){
            window.event.cancelBubble = true;
            var me=this;
            var msg="确认删除?";
            if(isRed) {
                msg="确认删除?未领取的红包金额将退回个人账户。"
            }
            $.util.ok(msg,function(){
                 $.req.get("call.json?module=shenqi&customerId={$customerId}&method=deleteShare",{
                    userName:"{$userName}",
                    params:{
                        "id":id
                    }
                },function(data){
                    if(data && !data.code){
                       $("#item_"+id).remove();
                    }
                });
            });
        },
        go:function(id){
            var params={
                "qId":"{$qId}",
                "id":id
            }
            params=encodeURIComponent(JSON.stringify(params));
            location.href=baseUrl+'call.html?customerId={$customerId}&module=shenqi&method=getView&scope=1&params='+params;
        },
        getShareUrl:function(){
            var shareUrl="";
            var me=this;
            var params={
                "qId":"{$qId}",
                "formUId":"{$formUId}"
            }
            params=encodeURIComponent(JSON.stringify(params));
            shareUrl=baseUrl+'call.html?customerId={$customerId}&module=shenqi&method=index&scope=1&params='+params;
            return shareUrl;
        }   
    };
    $("#fanBtn").click(function(){
        $.util.mask("#000",.8,1);
        $("#FBox").show();
    });
    $("#FBox i").click(function(){
        $("#mask").remove();
        $("#FBox").hide();
    });
    var shareUrl=artifact.getShareUrl();
    wx_share.init({
        "pkg":{
            "appId": '{$pkg.appId}',
            "timestamp": {$pkg.timestamp},
            "nonceStr": '{$pkg.nonceStr}',
            "signature": '{$pkg.signature}'
        },
        hide:1
    });
</script>
</html>